package com.coder.widget.guide

import android.graphics.Canvas
import android.graphics.Path
import android.graphics.Region
import android.graphics.drawable.ColorDrawable

/**
 * @description 描述
 * @author yuhus
 * @date 2021/4/12 11:45
 */
class HoleDrawable(color: Int, private val outPath: Path) : ColorDrawable(color) {

    override fun draw(canvas: Canvas) {
        canvas.save()
        canvas.clipPath(outPath, Region.Op.DIFFERENCE)
        super.draw(canvas)
        canvas.restore()
    }
}